<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <script src="../jQuery-3.6.3.min.js"> </script>
    <script>
        $(function () {
            $("#a1").on("click", function () {
                alert("hello");
            }).trigger("click");
        })
    </script>
</head>

<body>
    <p>不良人</p>
    <input type="button" id="a1" value="一次事件">
</body>

</html>